//
//  SHD_music.m
//  B段项目
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 谢美娜. All rights reserved.
//

#import "SHD_music.h"
#import "GZ_Music.h"
static SHD_music *play;
@implementation SHD_music
+(SHD_music *)palyMusic
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        play = [[SHD_music alloc]init];
    });
    return play;
}
-(void)setMusicUrl:(NSString *)musicUrl plagFlag:(NSInteger)flag
{
    _playMusic = [[AVPlayer alloc]initWithURL:[NSURL URLWithString:musicUrl]];
    if (musicUrl) {
        if (flag == 0) {
            
            [_playMusic play];
            [[GZ_Music shareInstance]stopMusic];
        }
        else
        {
            [_playMusic pause];
            
        }
    }
    else
    {
        NSLog(@"播放失败");
    }
}
- (void)stopMusic
{
    [_playMusic pause];
}
- (void)playMusicAgain
{
    [_playMusic play];
}
@end
